<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
</head>
<body>
<form th:action="@{/userAdd}" method="post">
    姓名：<input type="text" name="name"><span th:errors="${user.name}" style="color: red;"></span><br>
    密码：<input type="password" name="password"><br>
    <input type="submit" value="ok">
</form>
<hr>
<table>
    <tr>
        <td>姓名</td>
        <td>年龄</td>
        <td>index</td>
        <td>count</td>
    </tr>
    <tr th:each="user,var:${stuList}">
        <td th:text="${user.name}"></td>
        <td th:text="${user.age}"></td>
        <td th:text="${var.index}"></td>
        <td th:text="${var.count}"></td>
    </tr>
</table>
</body>
</html>